package Arrays_;

import java.util.Scanner;

/**
 * @author wly
 * @version V1.0.0
 * @date 2023/2/27 10:02
 *
 * https://www.lanqiao.cn/problems/504/learning/?first_category_id=1&sort=students_count&second_category_id=3
 */
public class word_analysis {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String words = scanner.nextLine();
        scanner.close();
        int[] table = new int[26];
        for (int i = 0; i < words.length(); i++) {
            int index = words.charAt(i) - 97;
            table[index]++;
        }

        int maxIndex = 0;
        for (int i = 0; i < table.length; i++) {
            if (table[i] > table[maxIndex]){
                maxIndex = i;
            }
        }

        System.out.println((char)(maxIndex + 97));
        System.out.print(table[maxIndex]);
    }
}
